
//dllmain.cpp

#include <windows.h>

wchar_t log[1024] = { 0 };

BOOL APIENTRY DllMain(HMODULE hModule,
	DWORD  ul_reason_for_call,
	LPVOID lpReserved
	)
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		wsprintfW(log, L"DLL_PROCESS_ATTACH tid:%d \n", GetCurrentThreadId());
		::OutputDebugStringW(log);
		break;
	case DLL_THREAD_ATTACH:
		wsprintfW(log, L"DLL_THREAD_ATTACH tid:%d \n", GetCurrentThreadId());
		::OutputDebugStringW(log);
		break;
	case DLL_THREAD_DETACH:
		wsprintfW(log, L"DLL_THREAD_DETACH tid:%d \n", GetCurrentThreadId());
		::OutputDebugStringW(log);
		break;
	case DLL_PROCESS_DETACH:
		wsprintfW(log, L"DLL_PROCESS_DETACH tid:%d \n", GetCurrentThreadId());
		::OutputDebugStringW(log);
		break;
	}
	return TRUE;
}

